package org.apache.minibase;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Table;

import com.demo.minibase.Bytes;

public class MyDemo {
	
	public static void main(String[] args) throws Exception {
		Configuration conf = HBaseConfiguration.create();
		Connection connection = ConnectionFactory.createConnection(conf);
		Admin admin = connection.getAdmin();
		admin.createTable(null);
		Table user = connection.getTable(TableName.valueOf("user"));
		Put put = new Put(Bytes.toBytes("rk01"));
		put.addColumn("family".getBytes(), "qualifier".getBytes(), "value".getBytes());
		user.put(put);
	}

}
